package sg.com.techstudio.tafep.validator;

import org.springframework.stereotype.Component;

@Component("chequeContactValidator")
public class ChequeContactValidator extends BaseValidator {
	/*
	private static final Log log = LogFactory.getLog(RegisterObjValidator.class);
	
	public void validateCheque(ChequeContact c, ValidationContext context) {
		log.debug("validateCheque() entry");
		MessageContext messages = context.getMessageContext();
		
		if(StringUtils.isBlank(c.getName()))
			messages.addMessage(new MessageBuilder().error().source("name")
					.code("required.field").build());
		if(StringUtils.isBlank(c.getContact()))
			messages.addMessage(new MessageBuilder().error().source("contact")
					.code("required.field").build());
		else if(!PHONE_PATTERN.matcher(c.getContact()).matches())
			messages.addMessage(new MessageBuilder().error().source("contact")
					.code("invalid.mobile").build());
		if(StringUtils.isBlank(c.getEmail()))
			messages.addMessage(new MessageBuilder().error().source("email")
					.code("required.field").build());
		else if(!EMAIL_PATTERN.matcher(c.getEmail()).matches())
			messages.addMessage(new MessageBuilder().error().source("email")
					.code("invalid.email").build());
		if(StringUtils.isBlank(c.getAddress()))
			messages.addMessage(new MessageBuilder().error().source("address")
					.code("required.field").build());
	}
	*/
}
